package com.cskaoyan.config;

import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;

/**
 * @author stone
 * @date 2022/11/15 15:46
 */
public class ApplicationInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {
    // Listener使用的配置类
    @Override
    protected Class<?>[] getRootConfigClasses() {
        return new Class[]{RootConfiguration.class};
    }
    // DispatcherServlet使用的配置类
    @Override
    protected Class<?>[] getServletConfigClasses() {
        return new Class[]{WebConfiguration.class};
    }

    // DispatcherServlet的url-pattern  → /
    @Override
    protected String[] getServletMappings() {
        return new String[]{"/"};
    }
}
